<!--
 * @Descripttion: 后台管理系统
 * @version: 1.0
 * @Author: 狸猫
 * @Date: 2024-01-24 09:18:56
 * @LastEditors: 狸猫
 * @LastEditTime: 2024-01-24 14:11:01
-->
<template>
  <div class="content">
    <el-dialog
      :title="title"
      :visible.sync="visible"
      width="1000px"
      append-to-body
      :before-close="close"
    >
      <el-tabs v-model="activeName">
        <el-tab-pane label="基础信息" name="base">
          <el-descriptions title="楼盘信息" direction="vertical" :column="4" :colon="false">
            <el-descriptions-item label="分布类型">
              <dict-tag
                :options="dict.type.dict_estate_type"
                :value="estate.estateType"
            /></el-descriptions-item>
            <el-descriptions-item label="楼盘编号">{{
              estate.estateId
            }}</el-descriptions-item>
            <el-descriptions-item label="楼盘名称">{{
              estate.estateName
            }}</el-descriptions-item>
            <el-descriptions-item label="楼盘地址">
              {{ estate.premisesAddress }}
            </el-descriptions-item>
            <el-descriptions-item label="经纬度">
              经度：{{ estate.longitude }}、纬度{{
                estate.latitude
              }}</el-descriptions-item
            >
            <el-descriptions-item label="楼栋数">{{
              estate.buildingNumber
            }}</el-descriptions-item>
            <el-descriptions-item label="单元数">{{
              estate.unitNumber
            }}</el-descriptions-item>
            <el-descriptions-item label="房间数">{{
              estate.houseNumber
            }}</el-descriptions-item>
<!--            <el-descriptions-item label="关联物业">{{-->
<!--              estate.propertyName-->
<!--            }}</el-descriptions-item>-->
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane label="拓展信息" name="second"></el-tab-pane>
      </el-tabs>
    </el-dialog>
  </div>
</template>
<script>
import { getEstate } from "@/api/house/estate";
export default {
  dicts: ["dict_estate_type"],
  name: "estateDetail",
  components: {},
  computed: {},
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    estate: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {
      activeName: "base",
      dialogSelectHouseVisible: false,
      title: "详情",
      form: {},
    };
  },
  created() {},
  mounted() {
    this.getdata();
  },
  methods: {
    handleClick() {},
    getdata() {
      getEstate(this.estate.estateId).then((res) => {
        this.form = res.data;
      });
    },
    //房间选择回调
    selectHouseCb(data) {
      this.selectHouseObj = data;
      let houseObj = {
        houseId: "", //房屋id
        provinceId: "", //省
        provinceName: "", //省份名称
        cityId: "", //市
        cityName: "", //市名称
        districtId: "", //区
        districtName: "", //区名称
        streetId: "", //所属街道
        streetName: "", //街道名称
        communityId: "", //所属社区
        communityName: "", //所属社区名称
        premisesAddress: null, //小区地址
        roomNumber: "", //房间号
        estateId: "", //楼盘id
        estateName: "", //楼盘名称
        buildingId: "", //楼栋id
        buildingName: "", //楼栋名称
        unitId: "", //单元id
        unitName: "", //单元名称
        floors: undefined, //层数
      };
      for (const key in houseObj) {
        houseObj[key] = data[key];
      }
      this.form = { ...this.form, ...houseObj };
    },
    onSubmit() {
      this.form.orderId = this.orderInfo.orderId;
      let form = {
        orderId: this.form.orderId,
        houseId: this.form.houseId,
      };
      this.$refs["form"].validate((valid) => {
        if (valid) {
        }
      });
    },
    close() {
      this.$emit("closeeldialog");
    },
  },
};
</script>
<style lang="sasss" scoped></style>
